//
//  YDRuntimePeople+YDAddProperty.m
//  YDBASE
//
//  Created by rowena on 2019/4/22.
//  Copyright © 2019年 wuyezhiguhun. All rights reserved.
//

#import "YDRuntimePeople+YDAddProperty.h"

//Runtime需要的头文件
#import <objc/runtime.h>

@implementation YDRuntimePeople (YDAddProperty)

- (void)setPeopleSex:(NSString *)peopleSex {
    objc_setAssociatedObject(self, @selector(peopleSex), peopleSex, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

- (NSString *)peopleSex {
    return objc_getAssociatedObject(self, @selector(peopleSex));
}

//添加一个自定义方法，用于清除所有的关联属性
- (void)clearAssociatedObjects {
    objc_removeAssociatedObjects(self);
}

@end
